/**
 * 
 */
package com.coolgame.action.base;

import java.util.Map;

import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.interceptor.ServletRequestAware;
import org.apache.struts2.interceptor.ServletResponseAware;
import org.apache.struts2.interceptor.SessionAware;
import org.apache.struts2.util.ServletContextAware;

import com.opensymphony.xwork2.ActionSupport;

/**
 * 
 * @copyright : (C) Copyright cool game Corporation 2011-2020
 * @date:2013-6-24
 * @author:Caiyw
 * @since JDK1.6
 * @description:TODO
 */
public class BaseAction extends ActionSupport implements ServletRequestAware, ServletResponseAware, SessionAware,
		ServletContextAware {

	private static final long serialVersionUID = 3999631588728949578L;
	protected HttpServletRequest request;
	protected HttpServletResponse response;
	protected ServletContext servletContext;
	protected Map<String, Object> session;

	public Object getFieldFromSession(String name) {
		return session.get(name);
	}

	public HttpServletRequest getRequest() {
		return request;
	}

	public Map<String, Object> getSession() {
		return session;
	}

	public void setServletRequest(HttpServletRequest arg0) {
		request = arg0;
	}

	public void setServletResponse(HttpServletResponse arg0) {
		response = arg0;
	}

	public void setSession(Map<String, Object> arg0) {
		session = arg0;
	}

	public void setServletContext(ServletContext arg0) {
		servletContext = arg0;
	}
}
